import moment from 'moment'
const lock_field = {
    "addDisplay": false,
    "addDisabled": false,
    "editDisplay": false,
    "editDisabled": true,
    "showColumn": false,
};
export const tableOption = {
    title: '表格的标题',
    "border": true,
    "index": true,
    "indexLabel": "序号",
    "stripe": true,
    "menuAlign": "center",
    "align": "center",
    "searchMenuSpan": 6,
    "span": 24,
    dialogWidth: 800,
    "column": [{
            ...lock_field,
            "type": "input",
            "label": "编号",
            "prop": "gongyiId",
        }, {
            ...lock_field,
            "type": "input",
            "label": "学籍号",
            "prop": "gongyiStudent",
        }, {
            ...lock_field,
            "type": "input",
            "label": "学期编号",
            "prop": "gongyiTerm",
            "hide": true,
        }, {
            "type": "select",
            "label": "类别",
            "prop": "gongyiCategory",
            dicData: dict.szpj_gongyi_type,
            // rules:[{required: true, message: "必填内容，不能为空", trigger: "blur" }],
            span: 12
        }, {
            "type": "input",
            "label": "内容",
            "prop": "gongyiTitle",
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        }, {
            "type": "input",
            "label": "地点",
            "prop": "gongyiAddress",
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        },
        {
            "type": "daterange",
            "label": "活动日期",
            "prop": "gongyiDate",
            "span": 14,
            "format": "yyyy-MM-dd",
            "valueFormat": "yyyy-MM-dd 00:00:00",
            "value": [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 00:00:00')],
            formatter: (row, value, label, column) => { return value.join(' 至 ').replace(/00:00:00/g, '') },
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        }, {
            "type": "input",
            "label": "次数",
            "prop": "gongyiTimes",
            "span": 8,
            "append": "每天",
            value: 1,
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        },
        {
            "type": "timerange",
            "label": "活动时间",
            "prop": "gongyiTime",
            "format": "HH:mm",
            "valueFormat": "1970-01-01 HH:mm:00",
            "span": 14,
            "value": [moment().subtract(1, 'hours').format('1970-01-01 HH:mm:00'), moment().format('1970-01-01 HH:mm:00')],
            formatter: (row, value, label, column) => { return value.join(' 至 ').replace(/1970-01-01 (\d{2}:\d{2}):00/g, '$1') },
        },
        {
            "type": "input",
            "label": "持续时间",
            "prop": "gongyiHowLong",
            "append": "小时/每次",
            "span": 10,
            value: 1,
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        }, {
            "type": "input",
            "label": "承担任务",
            "prop": "gongyiMyJob",
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        }, {
            "type": "textarea",
            "label": "完成及获奖情况",
            "prop": "gongyiContent",
            rules: [{ required: true, message: "必填内容，不能为空", trigger: "blur" }],
        }, {
            "type": "input",
            "label": "证明人",
            "prop": "gongyiCertifier"
        }, {
            ...lock_field,
            "type": "input",
            "label": "创建人",
            "prop": "gongyiCreateUser",
        }, {
            ...lock_field,
            "type": "input",
            "label": "",
            "prop": "gongyiCreateTime",
        }, {
            ...lock_field,
            "type": "input",
            "label": "审核人",
            "prop": "gongyiApproveUser",
        }, {
            ...lock_field,
            "type": "input",
            "label": "",
            "prop": "gongyiApproveTime",
        }
    ],
    group: [{
        label: "附件",
        column: [{
            "type": "upload",
            "label": "附件",
            "prop": "attachment",
            "action": "/szpj/file/zp_gong_yi/upload",
            "multiple": true,
        }],
    }],

}